<?php
/***************************************************************
*  Copyright notice
*
*  (c) 2008 Johannes Held <uni@hehejo.de>
*  All rights reserved
*
*  This script is part of the TYPO3 project. The TYPO3 project is
*  free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2 of the License, or
*  (at your option) any later version.
*
*  The GNU General Public License can be found at
*  http://www.gnu.org/copyleft/gpl.html.
*
*  This script is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/

require_once(PATH_tslib.'class.tslib_pibase.php');


/**
 * Plugin 'page footer' for the 'univis2typo3' extension.
 *
 * @author	Starbugs <univis2typo3@googlegroups.com>
 * @package	TYPO3
 * @subpackage	tx_univis2typo3
 */
class tx_univis2typo3_pi6 extends tslib_pibase {
	var $prefixId      = 'tx_univis2typo3_pi6';		// Same as class name
	var $scriptRelPath = 'pi6/class.tx_univis2typo3_pi6.php';	// Path to this script relative to the extension dir.
	var $extKey        = 'univis2typo3';	// The extension key.
	
	/**
	 * The main method of the PlugIn
	 *
	 * @param	string		$content: The PlugIn content
	 * @param	array		$conf: The PlugIn configuration
	 * @return	The content that is displayed on the website
	 */
	function main($content,$conf)	{
		$this->conf=$conf;
		$this->pi_setPiVarDefaults();
		$this->pi_loadLL();
		$this->pi_USER_INT_obj=1;	// Configuring so caching is not expected. This value means that no cHash params are ever set. We do this, because it's a USER_INT object!
		
		$page_select = t3lib_div::makeInstance("t3lib_pageSelect");
		$page_select->init(false);

		$language = $GLOBALS["TSFE"]->sys_language_uid;
		$links = array();
		if ($language == 0) {
			$links[] = array( 'text' => 'Overview A-Z',       'url' => 'sitemap-a-z' );
			$links[] = array( 'text' => 'Legal information',  'url' => 'legal-information' );
			$links[] = array( 'text' => 'Driving directions', 'url' => 'directions' );
			//$information_string = 'Information about the site';
			$last_change = 'Last update:';
			$date_format = 'm/d/Y \a\t g:i A';
		} else {
			$links[] = array( 'text' => '&Uuml;bersicht A-Z', 'url' => 'sitemap-a-z' );
			$links[] = array( 'text' => 'Impressum',          'url' => 'impressum' );
			$links[] = array( 'text' => 'Anfahrt',            'url' => 'anfahrt' );
			//$information_string = 'Informationen &uuml;ber die Seite';
			$last_change = 'Letzte &Auml;ndeurng:';
			$date_format = '\a\m d.m.Y \u\m H:i';
		}
		 
		$content='<h2>
				<a name="footermarke" id="footermarke">
				' . $information_string .'
				</a>
			</h2>

			
			<p>'. $last_change . ' ' . date($date_format, $GLOBALS['TSFE']->page['tstamp']).'</p>
						
			<div id="footerinfos">
				<div id="tecmenu">
				<h2 class="u">
					<a name="hilfemarke" id="hilfemarke">Technical menu</a>
				</h2>
				<ul>';
		$lcnt=count($links);
		for ($i=0; $i<$lcnt; ++$i)
		{
			// TODO: add CSS classes "first" and "last"
			$l =& $links[$i];
			$class='';
			if (0==$i) $class='class="first" ';
			if ($lcnt-1==$i) $class='class="last" ';
			$content .= '<li><a '.$class.'href="'.$row['url'].'/'.$l['url'].'/">'.$l['text'] .'<span class="skip">. </span></a></li>';
		}
		$content .= '</ul>
				<br />
				</div> 
			</div>'; // <!-- /footerinfos -->		
	
		return $this->pi_wrapInBaseClass($content);
	}
}



if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/univis2typo3/pi6/class.tx_univis2typo3_pi6.php']) {
	include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/univis2typo3/pi6/class.tx_univis2typo3_pi6.php']);
}

?>
